home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swagd_f.zip / EGAVGA.SWG / 0128_VGA-TEXT-FONT-EDITOR.pas < prev    next >
Pascal/Delphi Source File  |  1994-08-24  |  3KB  |  88 lines

  1. {
  2. DL> When i redefine a character as "─", i don't get a smooth line, but one
  3. DL> pixel left blank between every character, so "---" instead of "───".
  4.  
  5. With EGA, everything used to be so simple: all characters are 8x16 bits.
  6.  
  7. With VGA, there's an odd difference; you'll love this story.  Somebody in
  8. IBM once said, "Why not do our share in making this universe a complete
  9. chaos, and thus implement an infuriating and highly illogical technological
  10. mess in this new system we're calling VGA?"  Of course.  The brilliant new
  11. invetion, ladies and germs, was the 9th vertical line.  It's all gone into
  12. the history books by now; it tooks months and truckloads of money just to
  13. think it up but as always, IBM succeeded.
  14.  
  15. Now, all characters in the VGA font set are 8 bits, or pixels, wide.
  16. Except for 24 characters, 192 through 216 in ASCII.  These characters have
  17. an additional vertical line; no problem.  The truly ingenious touch (as the
  18. lesser-known Harry Stottle of the celebrated IBM Vertical Line Team said,
  19. "Eureka!") is how this addition line is actually a copy of the 8th.
  20.  
  21. Ie., to make a horizontal line ('─'), use any of the characters 192-216 and
  22. activate 8 bits from left to right.  The 8th bit is copied to the 9th, and
  23. you've got a horizontal line.
  24.  
  25. And here the tale endeth.  Almost.  For it leaves to each hapless
  26. programmer to figure this out and now I told you.  Pass the tale on as the
  27. last oral tradition of the cybernetic age.
  28.  
  29. Lest we forget.
  30.  
  31. DL>      1 2 3 4 5 6 7 8    I believe the way to get this right, is to
  32. DL>     ┌─┬─┬─┬─┬─┬─┬─┬─┐   repeat column 8 (x).
  33. DL>    1│ │ │ │ │ │ │ │x│   However, i don't know how to do this...
  34. DL>    2│ │ │ │ │ │ │ │x│
  35. DL>    3│ │ │ │ │ │ │ │x│
  36. DL>    4│ │ │ │ │ │ │ │x│
  37. DL>     : : : : : : : : :
  38. DL>   15│ │ │ │ │ │ │ │x│
  39. DL>   16│ │ │ │ │ │ │ │x│   Please help,
  40. DL>     └─┴─┴─┴─┴─┴─┴─┴─┘   Dirk Loeckx. [@]
  41.  
  42. Don't forget, too: use IN/OUT or Port/PortW to program the video card.  If
  43. you use the BIOS routines, you'll generate flicker (even on a VGA card) and
  44. stress that poor old card.  In case you missed those routines in SWAG, here
  45. are my versions:
  46.  
  47.         procedure PutFontC (C : Char; var Data);
  48.           {-Define font character bitmap}
  49.         begin
  50.           inline($FA);
  51.           PortW[$3C4]:=$0402;
  52.           PortW[$3C4]:=$0704;
  53.           PortW[$3CE]:=$0204;
  54.           PortW[$3CE]:=$0005;
  55.           PortW[$3CE]:=$0006;
  56.           Move(Data, Mem[SegA000:Byte(C) * 32], 16);
  57.           PortW[$3C4]:=$0302;
  58.           PortW[$3C4]:=$0304;
  59.           PortW[$3CE]:=$0004;
  60.           PortW[$3CE]:=$1005;
  61.           PortW[$3CE]:=$0E06;
  62.           inline($FB);
  63.         end;
  64.  
  65.         procedure GetFontC (C : Char; var Data);
  66.           {-Retrieve font character bitmap}
  67.         begin
  68.           inline($FA);
  69.           PortW[$3C4]:=$0402;
  70.           PortW[$3C4]:=$0704;
  71.           PortW[$3CE]:=$0204;
  72.           PortW[$3CE]:=$0005;
  73.           PortW[$3CE]:=$0006;
  74.           Move(Mem[SegA000:Byte(C) * 32], Data, 16);
  75.           PortW[$3C4]:=$0302;
  76.           PortW[$3C4]:=$0304;
  77.           PortW[$3CE]:=$0004;
  78.           PortW[$3CE]:=$1005;
  79.           PortW[$3CE]:=$0E06;
  80.           inline($FB);
  81.         end;
  82.  
  83. (If you are using TP versions earlier than 7.0, replace "SegA000" with
  84. "$A000"... but you knew that.)
  85.  
  86.                     ttyl, Lew.
  87.                     lew.romney@thcave.bbs.no
  88.